<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="alert alert-warning-light">
        重要提示：

        <p>1.请下载模板，进行多条录入！<a style="color: blue;" href="/uploads/sn/demo.xlsx">模板</a></p>
    </div>
    {if $from == "order"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('产品')}:</label>
        <div class="col-xs-4 col-sm-2">
            <input class="btn btn-success" name="row[product]" type="button" value="{$product['name']}">
            <input name="row[product]" type="hidden" value="{$product['id']}">
        </div>
    </div>
    {else /}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('产品')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-product" data-rule="required" class="form-control selectpicker" name="row[product]">
                <option value="0">--请选择--</option>
                {foreach name="product_list" item="vo"}
                <option value="{$vo.id}">{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    {if $from == "order"}
    <div class="form-group stock">
        <label class="control-label col-xs-12 col-sm-2">{:__('To_type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-to_type" class="form-control" name="row[to_type]" readonly="readonly">
                <option value="2" selected>代理</option>
            </select>

        </div>
    </div>
    <div class="form-group stock" id="user">
        <label class="control-label col-xs-12 col-sm-2">{:__('To')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-to_sale" data-source="user/user/index" data-field="nickname" data-format-item="{nickname} - {mobile}" data-order-by="id" {if $group != 8} data-params='{"custom[pid]":"{$company_id}","custom[ptype]":"1"}' {/if} class="form-control selectpage" name="row[to_sale]" type="text" value="{$product['user_id']}" disabled>
        </div>
    </div>
    {else /}
    <div class="form-group stock">
        <label class="control-label col-xs-12 col-sm-2">{:__('To_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-to_type" class="form-control" name="row[to_type]" readonly>
                {foreach name="toTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group stock" id="company" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('To')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-to_company" data-source="company/index" data-params='{"custom[pid]":"{$company_id}"}' class="form-control selectpage" name="row[to_company]" type="text" value="">
        </div>
    </div>
    <div class="form-group stock" id="user">
        <label class="control-label col-xs-12 col-sm-2">{:__('To')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-to_sale" data-source="user/user/index" data-field="nickname" data-format-item="{nickname} - {mobile}" data-order-by="id" {if $group != 8} data-params='{"custom[pid]":"{$company_id}","custom[ptype]":"1","custom[is_virtual]":"1"}'{else /}  data-params='{"custom[is_virtual]":"1"}' {/if} class="form-control selectpage" name="row[to_sale]" type="text" value="">
        </div>
    </div>
    {/if}
<!--    <div class="form-group stock">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('政策')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-policy_id" data-source="policy/index" data-order-by="id" data-field="title" data-params='{"custom[main_type]":"1","custom[main_id]":"{$company_id}"}' class="form-control selectpage" name="row[policy_id]" type="text" value="">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Data_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-data_type" data-rule="required" class="form-control selectpicker" name="row[data_type]">
                {foreach name="dataTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group" id="file_url" style="display: none;">
        <label for="c-file_url" class="control-label col-xs-12 col-sm-2">SN号:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-file_url" class="form-control" size="50" name="row[file_url]" type="text" value="" readonly>
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-url="ajax/uploadFile" data-input-id="c-file_url" data-mimetype=".xls,.xlsx" data-multiple="false" data-preview-id="p-file_url"><i class="fa fa-upload"></i> 上传</button></span>
                </div>
                <span class="msg-box n-right" for="c-file_url"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-file_url"></ul>
        </div>
    </div>
    <div class="form-group" id="sn">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sn')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-sn" class="form-control" rows="5" name="row[sn]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark_content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark_content" class="form-control" rows="5" name="row[remark_content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
